import http from '@/utils/http.js';

export default {
	// 数据列表
	sysUserListApi: data => {
		return http.post('/sysUser/list', data);
	},
	// 添加数据
	sysUserInsertApi: data => {
		return http.post('/sysUser/insert', data);
	},
	// 更新数据
	sysUserUpdateApi: data => {
		return http.post('/sysUser/update', data);
	},
	// 通过id获取详情
	sysUserDetailApi: params => {
		return http.get('/sysUser/detail', { params });
	},
	// 通过id批量删除数据
	sysUserDeleteByIdApi: data => {
		return http.post('/sysUser/deleteById', data, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } });
	},
	// 查询角色已关联角色
	getUserRelationRoleApi: userId => {
		return http.get(`/sysRole/userRelationRole/${userId}`);
	},
	// 用户关联角色
	setUserRelationRoleApi: data => {
		return http.post('/sysUser/userRelationRole', data);
	}
};
